package main

import (
	"fmt"
	"strconv"
)

func main() {
	//转换成字符串
	var (
		num1  int8    = 99
		num2  float64 = 23.456
		b     bool    = true
		achar byte    = 'h'
		str   string
	)

	str = fmt.Sprintf("%d", num1)
	str1 := fmt.Sprintf("%f", num2)
	str2 := fmt.Sprintf("%t", b)
	str3 := fmt.Sprintf("%c", achar)
	fmt.Println(str)
	fmt.Println(str1)
	fmt.Println(str2)
	fmt.Println(str3)

	//字符串转换成基本数据类型
	var stra string = "true"
	var b1 bool
	b1, _ = strconv.ParseBool(stra)
	fmt.Println(b1)

	fmt.Println("----------------------")
	var strb string = "1234567890"
	var n5 int64
	n5, _ = strconv.ParseInt(strb, 10, 64)
	fmt.Printf("%T:", n5)
}

//指针
